<?php
namespace app\index\controller;

use app\BaseController;

use app\index\logic\ExchangeLogic;
use app\index\logic\GoodsLogic;
use app\model\Token;
use app\model\User;
use app\service\WxService;
use think\facade\Request;

class Goods extends BaseController
{

    /*
     * 商品列表
     */
    public function index()
    {
        $goodsLogic = new GoodsLogic();
        success($goodsLogic->getList());
    }

    public function exchange()
    {
        $goodsId = input('param.goodsId');
        if(!$goodsId)   fail('请选择商品');

        $exchangeLogic = new ExchangeLogic();
        success($exchangeLogic->exchange($goodsId));
    }

    public function exchangeList()
    {
        $exchangeLogic = new ExchangeLogic();
        $list = $exchangeLogic->getList();
        success($list);
    }

    public function integralList()
    {
        $goodsLogic = new GoodsLogic();
        $list = $goodsLogic->getIntegralList();
        success($list);
    }
}
